I am trying to convert a group of images in a folder to animated gif and facing error "Cannot access a closed Stream.".Also there must be error in display image as lable..
protected void Button1_Click(object sender, EventArgs e) {
//Variable declaration
MemoryStream memoryStream;
binaryWriter = new BinaryWriter(stream);
int numFiles = fileEntries.Length;
for (int picCount = 0; picCount < numFiles; picCount++)
{
image = System.Drawing.Image.FromFile(fileEntries[picCount]);
image.Save(memoryStream, ImageFormat.Gif);
buf1 = memoryStream.ToArray();
memoryStream.SetLength(0);
}
binaryWriter.Close();
System.Drawing.Image streamGIF = System.Drawing.Image.FromStream(stream);
Label1.Text += "<img src=" + streamGIF + " /><br />";
}
Anonymous User
05-Feb-2015You need to store the image first on drive and then give its path to image tag.